package com.bykj.property.mapper.provider;

import com.bykj.property.controller.vo.request.ChargeStandardPageRequest;
import org.apache.ibatis.jdbc.SQL;

/**
 * @author yiming
 * @title: ChargeStandardSql
 * @projectName property
 * @description: TODO
 * @date 2019/6/2818:03
 */
public class ChargeStandardSql {
    public String getSql(ChargeStandardPageRequest pageRequest){
        return new SQL() {
            {
                SELECT("*");
                FROM("charge_standard");
                if(pageRequest.getChargeTypeId()!=null) {
                    WHERE("charge_standard_id=#{chargeTypeId}");
                }
                if(pageRequest.getPmVillageId()!=null) {
                    WHERE("pm_village_id=#{pmVillageId}");
                }

            }
        }.toString();

    }
}
